import { request } from './index';
/*
个人主页
*/
/**
 * @description 个人主页登录
 * @param code 钉钉返回的code
 */
export function homeLogin(code: string) {
  return request({
    url: '/homepage/api/login',
    params: { code }
  });
}
/**
 * @description 获取用户信息
 */
export function getUserInfo(source = 1) {
  return request({
    url: '/homepage/api/user_info',
    params: { source }
  });
}
/**
 * @description 我的业绩
 * @param params team_name, month
 */
export function getAchieve(params?: AnyObject) {
  return request({
    url: '/homepage/api/performance',
    params
  });
}
/**
 * @description 我的项目
 */
export function getProject(params = {}) {
  return request({
    url: '/homepage/api/myproject',
    params
  });
}
/**
 * @description 我的项目列表
 * @param params: type:number, page = 1, pagesize = 15 type 1延期项目 2正常项目 3已完成项目
 */
export function getProjectList(params?: AnyObject) {
  return request({
    url: '/homepage/api/project_list',
    params
  });
}
/**
 * @description 我的学习
 */
export function getStudy() {
  return request({
    url: '/homepage/api/study'
  });
}
/**
 * @description 我的福利/荣誉/处分
 * @param params type: number, page = 1, pagesize = 15 1福利 2荣誉 3处分
 */
export function getFRC(params?: AnyObject) {
  return request({
    url: '/homepage/api/reward',
    params
  });
}
/**
 * @description 生产状态
 */
export function getProdStatus() {
  return request({
    url: '/homepage/api/production'
  });
}
/**
 * @description 公告
 */
export function getAnnounce() {
  return request({
    url: '/homepage/api/notice'
  });
}
/**
 * @description 客诉情况
 */
export function getComplaint() {
  return request({
    url: '/homepage/api/complaint'
  });
}
/**
 * @description 个人资料
 */
export function getProfile() {
  return request({
    url: '/homepage/api/information'
  });
}
/**
 * @description 我的绩效
 * @param params page, pagesize
 */
export function getMyScore(params?: AnyObject | null) {
  return request({
    url: '/homepage/api/score',
    params
  });
}
/**
 * @description 退货情况
 */
export function getReturnCase(params = {}) {
  return request({
    // url: '/oa/ebay/order/getUserCenterProductRefundRate',
    url: '/oa/api/ebay/order/getUserCenterProductRefundRate',
    params
  });
}
/**
 * @description 我的待办
 * @param params next_token:分页游标
 */
export function getDealtList(params: AnyObject) {
  return request({
    url: '/homepage/api/pending',
    params
  });
}
/**
 * @description 电子期刊
 * @param params page, pagesize
 */
export function getJournal(params: AnyObject) {
  return request({
    url: '/homepage/api/journal',
    params
  });
}
/**
 * @description 部门业绩
 */
export function getDepartmentScore() {
  return request({
    url: '/homepage/api/dept_performance'
  });
}
/**
 * @description 我的绩效-图表
 */
export function getKpi() {
  return request({
    url: '/homepage/api/score_table'
  });
}
/**
 * @description 我的新闻
 */
export function getNews() {
  return request({
    url: '/homepage/api/news_list'
  });
}
/**
 * @description 客诉列表
 */
export function complaintList(params = {}) {
  return request({
    url: '/homepage/api/complaint_list',
    params
  });
}
/**
 * @description 项目汇总
 */
export function itemAggregate(params = {}) {
  return request({
    url: '/homepage/api/project_company',
    params
  });
}
/**
 * @description 生产状态详情
 */
export function productCaseList(params = {}) {
  return request({
    url: '/homepage/api/production_list',
    params
  });
}
/**
 * @description 绩效详情
 */
export function scoreDetail(id: number) {
  return request({
    url: '/homepage/api/score_details',
    params: { id }
  });
}
/**
 * @description 历史绩效
 */
export function historyScore(params = {}) {
  return request({
    url: '/homepage/api/score_list',
    params
  });
}
/**
 * @description 组织绩效
 */
export function organizeScore(params: AnyObject) {
  return request({
    url: '/homepage/api/organize',
    params
  });
}
/**
 * @description 客诉情况详情
 */
export function complaintDetail(params = {}) {
  return request({
    url: '/homepage/api/complaint_details',
    params
  });
}
/**
 * @description 销售目标详情
 */
export function performanceDetail(params = {}) {
  return request({
    url: '/homepage/api/performance_details',
    params
  });
}
/**
 * @description 8d报告详情
 */
export function dReportDetail(params = {}) {
  return request({
    url: '/homepage/api/report',
    params
  });
}
/**
 * @description 组织绩效详情
 */
export function groupKpiDetail(params = {}) {
  return request({
    url: '/homepage/api/production_list',
    params
  });
}
/**
 * @description 组织绩效详情
 */
export function troubleDetail(params = {}) {
  return request({
    url: '/homepage/api/production_trouble',
    params
  });
}

/**
 * @description 登录接口(星卡协同办公平台)
 */
export function auth_login(params = {}) {
  return request({
    url: '/homepage/api/auth_login',
    params
  });
}
/**
 * @description 组织绩效折线图
 */
export function organizeChart(year?: number) {
  return request({
    url: '/homepage/api/organize_chart',
    params: { year }
  });
}
/**
 * @description 组织绩效列表
 */
export function organizeList(month?: string) {
  return request({
    url: '/homepage/api/organize_info',
    params: { month }
  });
}